# -*- coding: utf-8 -*-
from match import Extractor
import regex as re


class ZuiJiuJiaShiExtractor(Extractor):

    # 该辩护要点仅仅适用于交通肇事罪和危险驾驶罪
    @staticmethod
    def is_my_job(file_path):
        return "交通" in file_path or "驾驶" in file_path

    @staticmethod
    def extract(text):
        result = {}
        bian_hu_list = re.search(r"(醉酒|醉驾|酒后)", text) is not None
        result["醉酒驾驶"] = bian_hu_list
        return result


if __name__ == '__main__':
    print(ZuiJiuJiaShiExtractor.extract("被告人王红案发时虽然处于醉酒状态，但依法不影响对其刑事责任的认定，其自首和取得被害人家属谅解的情节在原审量刑时已予考虑"))
    print(ZuiJiuJiaShiExtractor.extract("被告人陈孙铭多次供述他酒后驾车，怕摩托车被查扣而高速逆行冲关时将游希良撞死"))
